<script src="/res/js/safecenter/sendsigncode.js" type="text/javascript"></script>
<link href="/res/css/respective/safecenter/back-safe.css" rel="stylesheet">
<style>
    .abtn-large {
        width: 100px;
        height: 36px;
        line-height: 36px;
    }
    .abtn {
        display: inline-block;
        width: 86px;
        height: 32px;
        line-height: 32px;
        margin: 3px 0;
        text-align: center;
        color: #fff;
        background: #00a8e6;
        border-radius: 3px;
    }
</style>
<form id="safeform" action="/safecenter/bindOrReset3" method="post">
    <div class="safeform emailfrom">
        <ul>
            <li>
                <label>手机号：</label>
                <div class="formfile">
                    <input type="text" class="backinput" placeholder="请输入手机号" name="contactname" maxlength="11" data-rule="required;mobile;remote[/safecenter/checkusername, contactname]" data-msg-required="请输入手机号" data-msg-mobile="不像是有效的手机号码。" data-target="#sendemail"/>
                    <a href="javascript:void(0);" class="sendma" atttip="mobileTip">获取短信验证码</a><span id="sendemail"></span>
                </div>
            </li>
            <li>
                <label>短信验证码：</label>
                <div class="formfile">
                    <input type="text" class="backinput" id="code" name="code" maxlength="6" placeholder="请输入验证码"/>
                </div>
            </li>
            <li>
                <label>&nbsp;</label>
                <div class="formfile">
                    <a href="javascript:void(0);" class="abtn abtn-large" onclick="next()">提交</a>
                </div>
            </li>
        </ul>
    </div>
</form>
<script>
//下一步
function next(){
    //验证码验证通过，跳转下一步，带值
    $("#safeform").isValid(function(){
        layer.post({
            url:"/user/updatePhone",
            data:$("#safeform").serialize(),
            success:function (data) {
                if(data.success){
                    layer.msgShort("绑定成功");
                    [#if callback??]
                        ${callback}(data.obj);
                    [/#if]
                }else{
                    layer.msgShort(data.msg);
                }
            }
        });
    });
}
</script>